/************************************************************************
 *
 * assert.h
 *
 * (c) Copyright 1996-2004 Analog Devices, Inc.  All rights reserved.
 * $Revision: 6 $
 ************************************************************************/

/* This header is NOT protected against multiple inclusion, 
 * per the requirements of the Ansi C Standard.
 */

#ifndef __NO_BUILTIN
#pragma system_header /* assert.h */
#endif

#undef assert
#ifdef NDEBUG
  #define assert(expr) ((void)0)
#else
  #ifndef _LIBC_ASSERT_DEFINED
    #define _LIBC_ASSERT_DEFINED

    #ifdef __cplusplus
      extern "C" {
    #endif
      extern void _Libc_assert(const char *);
    #ifdef __cplusplus
      }
    #endif
  #endif /* _LIBC_ASSERT_DEFINED */

  #define _LIBC_ASSERT_STR1(x)  _LIBC_ASSERT_STR2(x)
  #define _LIBC_ASSERT_STR2(x)  #x

  #define assert(expr) ((expr) ? (void)0 \
    : _Libc_assert(__FILE__ ":" _LIBC_ASSERT_STR1(__LINE__) \
    " assertion failed: \"" #expr "\"\n"))

#endif /* NDEBUG */
